# imports
import System.Reflection
import Castle.MonoRail.WindsorExtension
import Castle.Facilities.Logging
import Castle.Facilities.ActiveRecordIntegration
import DecisionesInteligentes.iEvalua.Web.Controllers
import DecisionesInteligentes.iEvalua.Web.Services
import DecisionesInteligentes.iEvalua.Helpers

# facilities
Facility(monorail_windsor_integration_facility, RailsFacility)
Facility(activerecord_integration_facility, ActiveRecordFacility,
	{
		@isWeb: true, 
		@isDebug: true,
		assemblies: [ Assembly.Load("DecisionesInteligentes.iEvalua.Models") ],
		child('config'): { 
			keyvalues() : {
				'show_sql': true,
				'command_timeout': 5000,
				'cache.use_query_cache': false,
				'hibernate.dialect': 'NHibernate.Dialect.PostgreSQL81Dialect',
				'hibernate.connection.provider': 'NHibernate.Connection.DriverConnectionProvider',
				'hibernate.connection.driver_class': 'NHibernate.Driver.NpgsqlDriver',
				'hibernate.connection.connection_string': '#{connectionString1}'
			}
		}
	}
)
Facility(logging_facility, LoggingFacility, { @loggingApi:"log4net" })

# controllers
Component(application_controller, ApplicationController)
Component(login_controller, LoginController)
Component(user_controller, UsersController)
Component(role_controller, RolesController)

# services
Component(authentication_service, IAuthenticationService, AuthenticationService)
Component(security_service, ISecurityService, SecurityService)
Component(password_helper, Password)